# internally used packages
find_package(OpenCV2 REQUIRED)
find_package(CVD REQUIRED)
#find_package(TooN REQUIRED tag)

# ---------------------------------------------------------------------

include_directories(
	${OpenCV2_INCLUDE_DIRS}
	${TooN_INCLUDE_DIRS}
	${CVD_INCLUDE_DIRS}
)

# btl components
# each of these is built as a separate static library
set(COMPONENTS
	Image
	Maths
	Utility
	RobustEstimation
	ViewGeometry
	Features
	Optimisation
	Bayes
	SLAM
)
set(COMPONENT_LIBS)

foreach (component ${COMPONENTS})
	add_subdirectory(${component})
	list(APPEND COMPONENT_LIBS "Btl${component}")
endforeach()

# libbtl.so is a shared library that just pulls in
# all the above libraries and their external dependencies
add_library(BTL SHARED)
set_target_properties(BTL PROPERTIES LINKER_LANGUAGE CXX)
target_link_libraries(BTL
	${COMPONENT_LIBS}
)
